package com.tangmu.rabbits.ui.activity.mine;

import android.app.Dialog;
import android.view.View;
import android.widget.RelativeLayout;

import com.tangmu.rabbits.R;
import com.tangmu.rabbits.base.BaseActivity;
import com.tangmu.rabbits.constants.Constants;
import com.tangmu.rabbits.widget.CommonDialog;

import butterknife.BindView;
import butterknife.OnClick;

public class CustomerServiceActivity extends BaseActivity {


    @BindView(R.id.rl_call_phone)
    RelativeLayout rlCallPhone;
    @BindView(R.id.rl_online_service)
    RelativeLayout rlOnlineService;

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.statusBarColor(R.color.transparent).titleBar(R.id.headerView).init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_customer_service;
    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initView() {
        setHeaderImage(Constants.Position.LEFT, R.drawable.icon_back, false, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        setHeaderTitle("客服中心");

    }

    @OnClick({R.id.rl_call_phone, R.id.rl_online_service})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_call_phone:
                new CommonDialog(mContext, R.style.dialog, new CommonDialog.OnCloseListener() {
                    @Override
                    public void onClick(Dialog dialog, boolean confirm) {
                        if (confirm) {
                            dialog.dismiss();
                        } else {
                            dialog.dismiss();
                        }
                    }
                })
                        .setPositiveButton("拨出")
                        .setNegativeButton("取消")
                        .setTitle("兔子家客服电话\n400-884-9900").show();

                break;
            case R.id.rl_online_service:
                startActivity(ChatActivity.class);
                break;
        }
    }
}
